package com.qzsoft.zhjd.monitoring.modules.videogroup.entity;

import java.util.Date;

import javax.validation.constraints.NotBlank;

import org.hibernate.validator.constraints.Length;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.qzsoft.jeemis.common.validator.group.AddGroup;
import com.qzsoft.jeemis.common.validator.group.UpdateGroup;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;

/**
 * @ClassName VideoGroupEntity
 * @Description 视频分组
 * @author linhuawei
 * @since 2022-03-24
 */
@Data
@EqualsAndHashCode(callSuper = false)
@NoArgsConstructor
@AllArgsConstructor
@Builder
@ToString
@TableName("n_video_group")
public class VideoGroupEntity {

    /**
     * 主键
     */
    @NotBlank(groups = UpdateGroup.class, message = "分组标识不可为空")
    @TableId(type = IdType.ASSIGN_UUID)
    private String id;

    /**
     * 基地编号
     */
    @NotBlank(groups = AddGroup.class, message = "所属基地不可为空")
    @TableField(updateStrategy = FieldStrategy.NEVER)
    private String baseCode;

    /**
     * 上级主键
     */
    @TableField(updateStrategy = FieldStrategy.NEVER)
    private String pcode;
    
    /**
     * 分组编号
     */
    @TableField(updateStrategy = FieldStrategy.NEVER)
    private String code;

    /**
     * 分组名称
     */
    @NotBlank(groups = { AddGroup.class, UpdateGroup.class }, message = "分组名称不可为空")
    @Length(groups = { AddGroup.class, UpdateGroup.class }, max = 20, message = "分组名称不可超过{max}个字")
    private String name;

    /**
     * 创建者
     */
    @TableField(fill = FieldFill.INSERT, updateStrategy = FieldStrategy.NEVER)
    private Long creator;

    /**
     * 创建时间
     */
    @TableField(fill = FieldFill.INSERT, updateStrategy = FieldStrategy.NEVER)
    private Date createDate;

    /**
     * 更新者
     */
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Long updater;

    /**
     * 更新时间
     */
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date updateDate;

}
